package com.reflect;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import com.t66y.meta.Topic;

/**
 * @author dingmingliang
 * 
 */
public class ResetFieldValueAdpt1 extends ResetFieldValueAdpt {

	/**
	 * (non-Javadoc)
	 * 
	 * @see com.reflect.ResetFieldValueAdpt#proc(java.lang.Object)
	 */
	public <T> T proc(T obj) {
		if (obj == null)
			return obj;

		if (obj instanceof String) {
			System.out.println(obj);
			return obj;
		} else
			return null;
	}

	/**
	 * @param argv
	 */
	public static void main(String[] argv) {
		List<Topic> list = new ArrayList<Topic>();
		for (int i = 0; i < 4; i++) {
			Topic t = new Topic();
			t.setDate("" + i);
			t.setTorrentUrlList(Arrays.asList(new String[] { "" + i * 10, "" + i * 100, "" + i * 1000 }));
			list.add(t);
		}
		Reflect.resetFieldValue(list, new ResetFieldValueAdpt1());
	}
}
